package com.dq.repository.org;


import com.dq.domain.org.Org;
import com.dq.domain.position.OrgPosition;
import com.dq.domain.sys.section.SysSection;
import com.dq.domain.setup.WorkRoyaltySet;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author liuhui
 * @date 2019/11/28 0028 09:44:10
 */
@Repository
public interface WorkRoyaltySetRepository extends JpaRepository<WorkRoyaltySet,Long> {
    Page<WorkRoyaltySet> findByOrgAndDeletedFalse(SysSection section, Pageable pageable);
    Long countByOrgAndDeletedFalse(Org org);

    WorkRoyaltySet findByOrgAndOrgPositionAndTopLimitPriceLessThanEqualAndLowerLimitPriceGreaterThanEqualAndDeletedFalse(SysSection org, OrgPosition orgPosition, BigDecimal price, BigDecimal prices);

    List<WorkRoyaltySet> findByOrgAndOrgPositionAndDeletedFalse(SysSection sysDept, OrgPosition orgPosition);
}
